﻿using System.Collections;
using System.Collections.Generic;
using BearUtil.Hidden;
using Sirenix.OdinInspector;
using UnityEngine;
namespace BearUtil
{
	[CreateNodeMenu("自定义节点/小镇选项"), Title("小镇选项")]
	public class TownChoose : BearNode
	{
		[LabelText("节点类型"), HideInInspector]
		public int type = 24;
		[SerializeField, HideLabel, ValueDropdown("GetActors"), OnValueChanged("setRoleId")]
		public ActorData _actor;
		private ActorData[] GetActors()
		{
			var storyGraph = ((graph as DialogGraph)?.owner.graph as StoryGraph);
			if (storyGraph == null)
				storyGraph = graph as StoryGraph;
			if (storyGraph != null)
			{
				var series = StoriesSetting.Instance.FindSeriesByStoryGraph(storyGraph);
				return series.Actors.ToArray();
			}
			return new ActorData[0];
		}

		[LabelText("角色名")]

		public int role_id;
		private void setRoleId(ActorData actor)
		{
			role_id = _actor.role_id;
		}
		[LabelText("继续-家装-委托-赠礼")]
		public string[] choose_text = new string[] { ""};
		public override bool isSaved { get => true; } 
	}
}
